package cn.z2huo.algorithm.fibonacci;

import java.util.Scanner;

/**
 * 使用递归方式计算斐波那契数列，算法效率不高
 * 
 * @author zyz
 *
 */
public class Main2 {

	public long feibo(int n) {
		if (n == 1) {
			return 1;
		}
		if (n <= 0) {
			return 0;
		}
		return feibo(n - 1) + feibo(n - 2);
	}

	public static void main(String[] args) {
		long n;
		System.out.println("请输入要计算的数列的位数：");
		Scanner sc = new Scanner(System.in);
		n = sc.nextLong();
		sc.close();
		Main2 main = new Main2();
		for (int i = 1; i <= n; i++) {
			System.out.println(main.feibo(i));
		}
	}
}
